package com.maserb.monitor.entity.card;

import com.maserb.monitor.entity.BaseIdEntity;
import com.maserb.monitor.entity.schoolStudent.SchoolStudentEntity;

import javax.persistence.*;

/**
 * 卡德一卡通信息
 */
@Entity
@Table(name = "ec_card")
public class EcCardEntity extends BaseIdEntity {

    private String cardNumber;
    //接受卡德传入的人员id
    private String personId;
    //接受卡德传入的操作类型 I:insert U:update D:delete
    private String type;
    private Integer state;

    private SchoolStudentEntity student;

    @Column(name = "card_number", length = 50)
    public String getCardNumber() {
        return cardNumber;
    }

    public void setCardNumber(String cardNumber) {
        this.cardNumber = cardNumber;
    }

    @Transient
    public String getPersonId() {
        return personId;
    }

    public void setPersonId(String personId) {
        this.personId = personId;
    }

    @Transient
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Column(name = "state")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "student_id")
    public SchoolStudentEntity getStudent() {
        return student;
    }

    public void setStudent(SchoolStudentEntity student) {
        this.student = student;
    }
}
